package com.javasm.exercise;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @classname:twoArray
 * @description:
 * @author: Mr.Z
 * @date: 2020/11/27 16:22
 * @version: 0.1
 * @since:1.8
 */
public class twoArray {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        System.out.println("请输入班级个数");
        int classNum = input.nextInt();
        int[][] studentscore = new int[classNum][];
        for (int i = 0; i < classNum; i++) {
            System.out.println("请输入第" + (i + 1) + "个班级的学生数量:");
            int stuNumber = input.nextInt();
            //这行代码是重点
            studentscore[i] = new int[stuNumber];
            for (int i1 = 0; i1 < stuNumber; i1++) {
                System.out.println("请输入第" + (i + 1) + "个班级的第" + (i1 + 1) + "个学生的成绩");
                int score = input.nextInt();
                studentscore[i][i1] = score;
            }
        }
        System.out.println(Arrays.deepToString(studentscore));
    }
}
